#!/bin/bash

set -e

FLANNEL_VERSION=v0.10.0-amd64

FLANNEL_URL=quay.io/coreos
ALIYUN_URL=registry.cn-qingdao.aliyuncs.com/kydev/coreos

images=(flannel:${FLANNEL_VERSION})


for imageName in ${images[@]} ; do
  docker pull $ALIYUN_URL-$imageName
  docker tag  $ALIYUN_URL-$imageName $FLANNEL_URL/$imageName
  docker rmi  $ALIYUN_URL-$imageName
done

docker images